package com.taobao.api.request;

import java.util.List;
import com.taobao.api.internal.mapping.ApiField;
import com.taobao.api.internal.mapping.ApiListField;
import com.taobao.api.TaobaoObject;
import java.util.Map;

import com.taobao.api.ApiRuleException;
import com.taobao.api.BaseTaobaoRequest;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.internal.util.json.JSONWriter;
import com.taobao.api.response.TmallNrOrderCreateAsyncResponse;

/**
 * TOP API: tmall.nr.order.create.async request
 * 
 * @author top auto create
 * @since 1.0, 2018.07.25
 */
public class TmallNrOrderCreateAsyncRequest extends BaseTaobaoRequest<TmallNrOrderCreateAsyncResponse> {
	
	

	/** 
	* 用户id
	 */
	private Long buyerId;

	/** 
	* 1
	 */
	private String param0;

	public void setBuyerId(Long buyerId) {
		this.buyerId = buyerId;
	}

	public Long getBuyerId() {
		return this.buyerId;
	}

	public void setParam0(String param0) {
		this.param0 = param0;
	}

	public void setParam0(NrASyncCreateOrderReqDto param0) {
		this.param0 = new JSONWriter(false,true).write(param0);
	}

	public String getParam0() {
		return this.param0;
	}

	public String getApiMethodName() {
		return "tmall.nr.order.create.async";
	}

	public Map<String, String> getTextParams() {		
		TaobaoHashMap txtParams = new TaobaoHashMap();
		txtParams.put("buyer_id", this.buyerId);
		txtParams.put("param0", this.param0);
		if(this.udfParams != null) {
			txtParams.putAll(this.udfParams);
		}
		return txtParams;
	}

	public Class<TmallNrOrderCreateAsyncResponse> getResponseClass() {
		return TmallNrOrderCreateAsyncResponse.class;
	}

	public void check() throws ApiRuleException {
	}
	
	/**
 * 1
 *
 * @author top auto create
 * @since 1.0, null
 */
public static class NrASyncCreateOrderItemReqDTO extends TaobaoObject {

	private static final long serialVersionUID = 4761856151752774168L;

	/**
		 * 购买数量
		 */
		@ApiField("buy_amount")
		private Long buyAmount;
		/**
		 * 优惠信息，已乘购买数量。同步创建时使用，异步创建时只在订单上记录，不做金额的扣减。单品抵扣金额，单位：分；
		 */
		@ApiField("discount_fee")
		private Long discountFee;
		/**
		 * 商品id
		 */
		@ApiField("item_id")
		private Long itemId;
		/**
		 * 商品sku id，淘系商品skuId
		 */
		@ApiField("sku_id")
		private Long skuId;
		/**
		 * 异步创建订单的商品单价，同步创建时使用淘系线上的价格。单位：分
		 */
		@ApiField("unit_price")
		private Long unitPrice;
	

	public Long getBuyAmount() {
			return this.buyAmount;
		}
		public void setBuyAmount(Long buyAmount) {
			this.buyAmount = buyAmount;
		}
		public Long getDiscountFee() {
			return this.discountFee;
		}
		public void setDiscountFee(Long discountFee) {
			this.discountFee = discountFee;
		}
		public Long getItemId() {
			return this.itemId;
		}
		public void setItemId(Long itemId) {
			this.itemId = itemId;
		}
		public Long getSkuId() {
			return this.skuId;
		}
		public void setSkuId(Long skuId) {
			this.skuId = skuId;
		}
		public Long getUnitPrice() {
			return this.unitPrice;
		}
		public void setUnitPrice(Long unitPrice) {
			this.unitPrice = unitPrice;
		}

}

	/**
 * 1
 *
 * @author top auto create
 * @since 1.0, null
 */
public static class NrASyncCreateOrderReqDto extends TaobaoObject {

	private static final long serialVersionUID = 7228445558679319359L;

	/**
		 * 业务身份标识
		 */
		@ApiField("biz_identity")
		private String bizIdentity;
		/**
		 * 1
		 */
		@ApiListField("items")
		@ApiField("nr_a_sync_create_order_item_req_d_t_o")
		private List<NrASyncCreateOrderItemReqDTO> items;
		/**
		 * 线下会员码
		 */
		@ApiField("out_member_code")
		private String outMemberCode;
		/**
		 * 门店code
		 */
		@ApiField("store_code")
		private String storeCode;
		/**
		 * 线下门店交易单号
		 */
		@ApiField("store_order_id")
		private String storeOrderId;
		/**
		 * 淘系会员码，优先级高
		 */
		@ApiField("taobao_member_code")
		private String taobaoMemberCode;
	

	public String getBizIdentity() {
			return this.bizIdentity;
		}
		public void setBizIdentity(String bizIdentity) {
			this.bizIdentity = bizIdentity;
		}
		public List<NrASyncCreateOrderItemReqDTO> getItems() {
			return this.items;
		}
		public void setItems(List<NrASyncCreateOrderItemReqDTO> items) {
			this.items = items;
		}
		public String getOutMemberCode() {
			return this.outMemberCode;
		}
		public void setOutMemberCode(String outMemberCode) {
			this.outMemberCode = outMemberCode;
		}
		public String getStoreCode() {
			return this.storeCode;
		}
		public void setStoreCode(String storeCode) {
			this.storeCode = storeCode;
		}
		public String getStoreOrderId() {
			return this.storeOrderId;
		}
		public void setStoreOrderId(String storeOrderId) {
			this.storeOrderId = storeOrderId;
		}
		public String getTaobaoMemberCode() {
			return this.taobaoMemberCode;
		}
		public void setTaobaoMemberCode(String taobaoMemberCode) {
			this.taobaoMemberCode = taobaoMemberCode;
		}

}


}